package cn.handwrit.service;

import cn.handwrit.springframework.spring.Autowired;
import cn.handwrit.springframework.spring.BeanNameAware;
import cn.handwrit.springframework.spring.Component;
import cn.handwrit.springframework.spring.InitializingBean;

@Component
public class OrderService implements BeanNameAware, InitializingBean {
    @Autowired
    private UserService userService;

    private String beanName;

    public void test() {
        System.out.println(userService);
        System.out.println(beanName);
    }

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println("初始化");
    }
}
